/**
 * 用户配置相关常量
 */
import { DEFAULT_THEME } from './theme'
import { FUNC_OPEN_TYPE } from './layout'

// 用户配置项键名和默认值
export const UserProfileKeyALL = [
  { key: "wrp_sidebarCollapsed", default: false },
  { key: "wrp_searchHistory", default: [] },
  { key: "wrp_theme", default: DEFAULT_THEME },
  { key: "wrp_funcOpenMode", default: FUNC_OPEN_TYPE.CURRENT },
];

/**
 * 获取配置项的默认值
 * @param {string} profileKey - 配置项键名
 * @returns {any} 默认值
 */
export function getUserProfileDefault(profileKey) {
  const res = UserProfileKeyALL.find((f) => f.key == profileKey);
  if (res) {
    return res.default;
  }
  return null;
}